package com.emeraldparser.util;

public final class ImmutableMapEntry<K, V> extends AbstractMapEntry<K, V> {

	private final K key;
	private final V value;

	public ImmutableMapEntry(K key, V value) {
		this.key = key;
		this.value = value;
	}

	public static <K, V> ImmutableMapEntry<K, V> create(K key, V value) {
		return new ImmutableMapEntry<K, V>(key, value);
	}

	@Override
	public K getKey() {
		return key;
	}

	@Override
	public V getValue() {
		return value;
	}

	@Override
	public V setValue(V value) {
		throw new UnsupportedOperationException();
	}

}
